home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
bbsutil
/
bsrc_250.zip
/
BTCTL.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-09-15
|
33KB
|
795 lines
/*--------------------------------------------------------------------------*/
/* */
/* */
/* ------------ Bit-Bucket Software, Co. */
/* \ 10001101 / Writers and Distributors of */
/* \ 011110 / Freely Available<tm> Software. */
/* \ 1011 / */
/* ------ */
/* */
/* (C) Copyright 1987-91, Bit Bucket Software Co., a Delaware Corporation. */
/* */
/* */
/* This module was written by Vince Perriello */
/* */
/* */
/* BinkleyTerm OMMM Control File Generator */
/* */
/* */
/* For complete details of the licensing restrictions, please refer */
/* to the License agreement, which is published in its entirety in */
/* the MAKEFILE and BT.C, and also contained in the file LICENSE.250. */
/* */
/* USE OF THIS FILE IS SUBJECT TO THE RESTRICTIONS CONTAINED IN THE */
/* BINKLEYTERM LICENSING AGREEMENT. IF YOU DO NOT FIND THE TEXT OF */
/* THIS AGREEMENT IN ANY OF THE AFOREMENTIONED FILES, OR IF YOU DO */
/* NOT HAVE THESE FILES, YOU SHOULD IMMEDIATELY CONTACT BIT BUCKET */
/* SOFTWARE CO. AT ONE OF THE ADDRESSES LISTED BELOW. IN NO EVENT */
/* SHOULD YOU PROCEED TO USE THIS FILE WITHOUT HAVING ACCEPTED THE */
/* TERMS OF THE BINKLEYTERM LICENSING AGREEMENT, OR SUCH OTHER */
/* AGREEMENT AS YOU ARE ABLE TO REACH WITH BIT BUCKET SOFTWARE, CO. */
/* */
/* */
/* You can contact Bit Bucket Software Co. at any one of the following */
/* addresses: */
/* */
/* Bit Bucket Software Co. FidoNet 1:104/501, 1:343/491 */
/* P.O. Box 460398 AlterNet 7:491/0 */
/* Aurora, CO 80046 BBS-Net 86:2030/1 */
/* Internet f491.n343.z1.fidonet.org */
/* */
/* Please feel free to contact us at any time to share your comments about */
/* our software and/or licensing policies. */
/* */
/*--------------------------------------------------------------------------*/
#include <stdio.h>
#include <signal.h>
#include <ctype.h>
#include <conio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef __TURBOC__
#include <alloc.h>
#define _fmalloc(n) farmalloc (n)
#define _ffree(n) farfree (n)
#endif
#ifdef _MSC_VER
#include <malloc.h>
#endif
#ifdef __WATCOMC__
#include <malloc.h>
#endif
#ifdef __ZTC__
#define _fmalloc(n) farmalloc (n)
#define _ffree(n) farfree (n)
#endif
typedef unsigned bit;
typedef unsigned int word;
typedef unsigned char byte;
struct parse_list {
int p_length;
char *p_string;
};
/*--------------------------------------------------------------------------*/
/* The following is excerpted from the control structures used by Opus 1.10 */
/* as it is currently implemented. The only part that really concerns BTCTL */
/* is that part of the _PRM structure that contains the version number and */
/* the network address. Only those parts are actually handled by this code. */
/* We suspect that no changes will be made in that part of the structure */
/* between now and the release of Opus 1.10. If I were you, I would make */
/* no such assumptions about the rest. */
/*--------------------------------------------------------------------------*/
#define THIS_CTL_VERSION 16 /* PRM structure version number */
#define CTLSIZE 1
#define OFS char*
#define MAX_EXTERN 8 /* max. number of external programs */
#define MAXCLASS 12 /* number of possible priv levels */
#define ALIAS_CNT 15 /* number of matrix addresses */
/*--------------------------------------------------------------------------*/
/* FIDONET ADDRESS STRUCTURE */
/*--------------------------------------------------------------------------*/
typedef struct _ADDRESS
{
word Zone;
word Net;
word Node;
word Point;
} ADDR;
/*--------------------------------------------------------------------------*/
/* Attributes of a given class of users */
/*--------------------------------------------------------------------------*/
struct class_rec
{
byte ClassPriv;
byte class_fill;
int max_time; /* max cume time per day */
int max_call; /* max time for one call */
int max_dl; /* max dl bytes per day */
word ratio; /* ul:dl ratio */
word min_baud; /* speed needed for logon */
word min_file_baud; /* speed needed for file xfer */
};
/*--------------------------------------------------------------------------*/
/* Registers to pass to a FOSSIL appendage */
/*--------------------------------------------------------------------------*/
struct _FOSREGS
{
word ax;
word bx;
word cx;
word dx;
};
/*--------------------------------------------------------------------------*/
/* The format of the PRM file, VERSION 16 */
/* */
/* THIS IS AN EXPLOSIVE STRUCTURE. IT IS SUBJECT TO CHANGE WITH NO NOTICE. */
/* */
/* Offsets to the following item(s) are guaranteed: */
/* */
/* byte version; // OFFSET 0, all versions */
/* byte task_num; // OFFSET 1, 16+ */
/* */
/*--------------------------------------------------------------------------*/
struct _PRM
{
/*-----------------------------------------------------------*/
/* DATA */
/*-----------------------------------------------------------*/
byte version; /* for safety STABLE*/
byte task_num; /* for multi-tasking systems STABLE*/
ADDR alias[ALIAS_CNT];
byte video; /* 0=Dos, 1=Fossil 2=IBM */
byte testmode; /* input from keyboard, not modem */
word carrier_mask;
word handshake_mask;
word